package ${controller};

import cn.hutool.core.lang.Assert;
import ${api}.${table.alias}Api;
import com.fingard.gardpay.common.bean.PageView;
import com.fingard.gardpay.common.bean.ResultContext;
import com.fingard.gardpay.common.enums.ENDownloadType;
import com.fingard.gardpay.common.export.ExportParam;
import com.fingard.gardpay.common.export.ExportUtil;
import ${dto}.${table.alias}DTO;
import ${param}.${table.alias}Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;

/**
 * @author ${author}
 * @version 1.0 ${date}
 */
@RestController
@RequestMapping("${interfaceAddress}")
public class ${table.alias}Controller {

    private final ${table.alias}Api ${table.propertyName}Api;

    @Autowired
    public ${table.alias}Controller(${table.alias}Api ${table.propertyName}Api) {
        this.${table.propertyName}Api = ${table.propertyName}Api;
    }

    @PostMapping("/queryPage.do")
    public PageView<${table.alias}DTO> queryPage(@RequestBody ${table.alias}Param ${table.propertyName}Param) {
         return ${table.propertyName}Api.listPage(${table.propertyName}Param);
    }


    @PostMapping("/getById.do")
    public ResultContext<${table.alias}DTO> getById(String id) {
    return ${table.propertyName}Api.getById(id);
    }

 }
